#pragma once

extern "C" 
{
	#include "lua.h"
	#include "lualib.h"
	#include "lauxlib.h"
}

class LuaWrapper
{
public:
	static void Init();
	static void Exit();

	// Access the lua state directly
	static lua_State* GetLuaState();

	// Register a C++ function
	static void RegisterFunction(const char* funcName, int(*func)(lua_State*));

	// File loading
	static int LoadFile(const char* file);
	static int ExecuteFile(const char* file);

	// Execute a lua function
	static int ExecuteLuaFunction(const char* function);

	// Used to read values directly from a lua table
	static const char* LuaTableGetString(const char* name, int idx);
	static double LuaTableGetNumber(const char* name, int idx);
};